class point{
public:
  double x, y;

  point()
  {
    x=y=0;
  }

  point(double _x, double _y)
  {
    x=_x;
    y=_y;
  }
  
  void print()
  {
    cout << x << " " << y << endl;
  }

  point project(point p0, double alpha)
  {
    point p;
    p.x = (y-p0.y + 1./alpha*x + alpha*p0.x)/(1/alpha+alpha);
    p.y = alpha*(y-p0.y + 1./alpha*x+alpha*p0.x)/(1/alpha+alpha) - alpha*p0.x + p0.y;
    return p;
  }

  double distance(point p)
  {
    return sqrt((x-p.x)*(x-p.x)+(y-p.y)*(y-p.y));
  }

  double distance2(point p)
  {
    return (x-p.x)*(x-p.x)+(y-p.y)*(y-p.y);
  }

  bool operator<(const point &b)
  {
    if(y < b.y)
        return true;
    else
        return false;
  }

  bool operator>(const point &b)
  {
    if(y < b.y)
        return false;
    else
        return true;
  }

  bool operator==(const point &b)
  {
    if(y == b.y)
        return true;
    else
        return false;
  }

  bool operator<(const double b)
  {
    if(y < b)
        return true;
    else
        return false;
  }

  bool operator>(const double b)
  {
    if(y > b)
        return true;
    else
        return false;
  }
  
};
